from rest_framework.generics import ListAPIView
from home.models import Banner, Nav
from home.serializers import BannerModelSerializer, NavModelSerializer

# Create your views here.

class BannerAPIView(ListAPIView):
    queryset = Banner.objects.filter(is_show=True, is_delete=False).order_by('orders')[:3]
    serializer_class = BannerModelSerializer


class TopNavAPIView(ListAPIView):
    queryset = Nav.objects.filter(is_show=True, is_delete=False, position=1).order_by('orders')
    serializer_class = NavModelSerializer


class BotNavAPIView(ListAPIView):
    queryset = Nav.objects.filter(is_show=True, is_delete=False, position=2).order_by('orders')
    serializer_class = NavModelSerializer
